<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="cmd.css" rel="stylesheet" type="text/css">
<title>GRUB4DOS 其他菜单解释2</title>
</head>

<body>
<p><a href="./GRUB4DOS9-1菜单解释_内置.htm">内置菜单详解 </a><span class="Notes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="./GRUB4DOS9-2菜单解释_外置.htm">外置菜单详解</a> <span class="Notes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="./GRUB4DOS9-3菜单解释_其他1.htm">其他菜单详解1</a> <span class="Notes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="./GRUB4DOS9-4菜单解释_其他2.htm">其他菜单详解2</a> <span class="Notes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>其他菜单详解3</p>
<h2>其他菜单文件详解-3</h2>
<p>另类用法，很简单的方法就可以阻止不熟悉的人使用你的电脑，</p>
<p>最终效果：开机后屏幕上只有 Please Input: 一行字符，需要输入正确才能进入相应系统</p>
<p>具体可以自己实验下，很有趣</p>
<p>#====================<strong>&nbsp;初始化命令组</strong>（菜单头）部分=========================</p>
<p><span class="bat">timeout</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置启动默认项等待时间为0</span>  <br>
  <span class="bat">default</span><strong> 0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置默认启动项</span><br>
  <span class="bat">hiddenmenu</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;隐藏菜单项</span><br>
  <span class="bat">password</span> <span class="Options">--md5</span> <strong>$1$j3M3$UCvLwNAO7wmLQXnYtJQMv1</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置全局密码</span></p>
<p>#====================<strong>菜单项</strong>（菜单正文）=================================</p>
<p><span class="Options">title</span> <strong><span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题为空，&quot; \n &quot;后为菜单底部帮助信息，此处也为空 </span><br>
  <span class="bat">clear</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;清空屏幕上所有显示信息</span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令有执行出错的话将返回菜单项0（本项菜单）执行</span><br>
  <span class="bat">set </span><span class="Options">/p</span> <strong>os=Please Input:</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;在屏幕上输出 Please Input: 字符串，并将用户输入的信息赋给变量 os</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==7</strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span> <strong>1</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 7 ，就跳转到菜单项1执行，进入win7系统</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==xp</strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span><strong> 2</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 xp ，就跳转到菜单项2执行 ，进入xp系统</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==pe</strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span><strong> 3</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 pe ，就跳转到菜单项3执行 ，进入pe系统</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==menu </strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span><strong> 4</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 menu ，就跳转到菜单项3执行 ，加载另外一个grub4dos菜单</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==ram</strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span><strong> 5</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 ram ，就跳转到菜单项5执行 ，启动ramos系统</span><br>
  <span class="bat">if </span><span class="Options">/i</span> <strong>%os%==bt4</strong> <span class="Options">&amp;&amp;</span> <span class="bat">goto</span><strong> 6</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果变量 os 的值是 bt4 ，就跳转到菜单项6执行 ，启动bt4系统</span><br>
  <span class="bat">kernel</span><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;人为制造错误来返回菜单项0（本项菜单）执行</span></p>
<p><span class="Options">title</span> <strong>1 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
  <span class="bat">find</span> <span class="Options">--set-root --devices</span><strong>=h /bootmgr</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;在所有磁盘类设备的根目录下寻找 bootmgr 文件，并将找到的设备设置为根</span><br>
  <span class="bat">chainloader</span> <strong>/bootmgr</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;加载引导文件 bootmgr</span><br>
  <span class="bat">boot</span><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;确定进行启动，菜单中可以省略该句，命令行模式下不可省略</span></p>
<p><span class="Options">title</span> <strong>2 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
  <span class="bat">find</span> <span class="Options">--set-root --devices</span><strong>=h /ntldr</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;在所有磁盘类设备的根目录下寻找 ntldr 文件，并将找到的设备设置为根</span><br>
  <span class="bat">chainloader</span> <strong>/ntldr</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;加载引导文件 ntldr</span><br>
  <span class="bat">boot</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;确定进行启动，菜单中可以省略该句，命令行模式下不可省略</span></p>
<p><span class="Options">title</span> <strong>3 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
  <span class="bat">find</span> <span class="Options">--set-root --devices</span><strong>=h /WXPE/SETUPLDR.BIN</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;在所有磁盘类设备的根目录下寻找 /WXPE/SETUPLDR.BIN 文件，并将找到的设备设置为根</span><br>
  <span class="bat">chainloader</span><strong> /WXPE/SETUPLDR.BIN</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;加载引导文件 /WXPE/SETUPLDR.BIN</span><br>
  <span class="bat">boot</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;确定进行启动，菜单中可以省略该句，命令行模式下不可省略</span></p>
<p><span class="Options">title</span> <strong>4 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
  <span class="bat">configfile</span> <strong>/MENU.LST</strong> <span class="Options">||</span> <span class="bat">find </span>-<span class="Options">-set-root --ignore-floppies </span><strong>/MENU.LST</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;加载当前设备根目录下的 MENU.LST 菜单文件，<br>
#&nbsp;&nbsp;&nbsp;失败的话就在所有非软驱设备的根目录下寻找 MENU.LST 文件，并将找到的设备设为根</span><br>
<span class="bat">configfile</span> <strong>/MENU.LST</strong><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;加载当前设备根目录下的 MENU.LST 菜单文件</span></p>
<p><span class="Options">title</span> <strong>5 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
  <span class="bat">fallback</span> <strong>0</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
  <strong>#</strong><span class="bat">checkrange</span> <strong>0x07</strong> <span class="bat">parttype</span><strong> (hd0,0) </strong><span class="Options">&amp;&amp;</span> <span class="bat">hide</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;检测第一磁盘第一主分区的分区类型，若为正常分区就将其隐藏<br>
  #&nbsp;&nbsp;&nbsp;目的是在启动ramos后原有盘符不后移</span><br>
  <span class="bat">if</span> <span class="Options">not exist</span><strong> /RAMXP.GZ </strong><span class="Options">&amp;&amp;</span> <span class="bat">find </span>-<span class="Options">-set-root --devices</span><strong>=h /RAMXP.GZ</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;如果当前设备根目录下没有 RAMXP.GZ 文件，<br>
  #&nbsp;&nbsp;&nbsp;就在所有磁盘设备的根目录下寻找 RAMXP.GZ 文件，并将找到的设备设为根</span><br>
  <span class="bat">map</span> <span class="Options">--mem</span> <strong>/RAMXP.GZ</strong><span class="bat"> (hd-1)</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;将 RAMXP.GZ 加载到内存后仿真为最后一个磁盘设备</span><br>
  <span class="bat">map</span> <span class="Options">--hook</span><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;使仿真立即生效</span><br>
  <span class="bat">root</span> <strong>(hd-1,0)</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;将刚刚仿真的磁盘设备设为根</span><br>
  <span class="bat">chainloader</span> <strong>/ntldr</strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;加载ramos系统引导文件 ntldr</span><br>
<span class="bat">boot</span><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;确定进行启动，菜单中可以省略该句，命令行模式下不可省略</span></p>
<p><span class="Options">title</span> <strong>6 <span class="Options">\n</span></strong><br>
  <span class="Notes">#&nbsp;&nbsp;&nbsp;设置菜单项标题，&quot; \n &quot;后为菜单底部帮助信息，此处为空 </span><br>
<span class="bat">fallback</span> <strong>0</strong><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;下列命令执行出错时，将跳转到菜单项0执行</span><br>
<span class="bat">configfile</span> <strong>/casper/grub/menu.bt4</strong> <span class="Options">||</span> <span class="bat">find </span>-<span class="Options">-set-root --devices</span><strong>=h /casper/grub/menu.bt4</strong><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;加载当前设备上的bt4系统</span><span class="Notes">菜单文件（/casper/grub/menu.bt4），<br>
  #&nbsp;&nbsp;&nbsp;失败的话就在所有磁盘设备上寻找 /casper/grub/menu.bt4 文件，并将找到的设备设为根</span><br>
  <span class="bat">configfile </span><strong>/casper/grub/menu.bt4</strong><br>
<span class="Notes">#&nbsp;&nbsp;&nbsp;加载当前设备根目录下的 MENU.LST 菜单文件</span></p>
<p>&nbsp;</p>
</body>
</html>
